package com.zkteco.coreservice;

import java.lang.String;

public class UdkService {

	static {
		System.loadLibrary("udk");
	}

	public static int UDK_PROT_DEFAULT = 0;
	public static int UDK_PROT_PULL = 1;
	public static int UDK_PROT_STANDALONE = 2;
	public static native long 
		UdkConnect(int[] prot,String parameters);

	public static native void 
		UdkDisconnect(long h);

	public static native int 
		UdkGetLastError(long h);
		
	public static native int 
		UdkSearchDevices(String commtype,String address,byte[] buffer,int[] bufferlength);

	public static native int 
		UdkGetLockCount(long h);

	public static native int 
		UdkSetLockState(long h,int lock_no,int opentime);

	public static native int 
		UdkGetLockState(long h,int lock_no);

	public static native int 
		UdkGetComPwd(long h, byte[] buffer, int[] BufferLen);
	public static native int 
		UdkMobileAtt(long h, int operate, String parameters, byte[] buffer,int[] bufferlength);

	public static native int 
		UdkGetDeviceParam(long h, byte[] buffer, int BufferLen, String items);


	public static native int 
		UdkSetDeviceParam(long h, String itemandvalues);

	public static native int
		UdkSetCallBack(long h, CBInterface cb);

	public static native int
		UdkResetCallBack(long h, CBInterface cb);

	public static native int 
		UdkResetDeviceExt(long h, String parameters);
	
	public interface CBInterface{
		/**
		 * the download process callback function
		 * @param type 0:means totalsize;1:means size has been read
		 * @param size
		 */
    public abstract void DownloadProcess(int type, int size);
}
}
